//package com.kungfuhacking.wristbandpro.find.presenter;
//
//import android.content.Context;
//import android.support.v7.widget.RecyclerView;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//import android.widget.RelativeLayout;
//import android.widget.TextView;
//
//import com.kungfuhacking.wristbandpro.R;
//import com.kungfuhacking.wristbandpro.find.bean.ListEntity;
//import com.kungfuhacking.wristbandpro.utils.DensityUtil;
//
//import java.util.List;
//
///**
// * Created by Aaron on 17/5/11.
// */
//
//public class LogisticsAdapter extends RecyclerView.Adapter<LogisticsAdapter.MyViewHolder> {
//
//    private Context context;
//    private List<ListEntity> listEntities;
//
//    public LogisticsAdapter(Context context, List<ListEntity> listEntities) {
//        this.context = context;
//        this.listEntities = listEntities;
//    }
//
//    public void setListEntities(List<ListEntity> listEntities) {
//        this.listEntities = listEntities;
//    }
//
//    @Override
//    public LogisticsAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//        return new LogisticsAdapter.MyViewHolder(
//                LayoutInflater.from(context).inflate(R.layout.item_logistics, parent,
//                        false));
//    }
//
//    @Override
//    public void onBindViewHolder(LogisticsAdapter.MyViewHolder holder, int position) {
//
//        holder.tv_status.setText(listEntities.get(position).getStatus());//订单状态
//        holder.tv_time.setText(listEntities.get(position).getTime());//时间
//
//        if (position == 0) {
//
//            //绿色的圆点
//            holder.iv_status.setImageResource(R.drawable.shape_circle_logistics_green);
//            RelativeLayout.LayoutParams pointParams = new RelativeLayout.LayoutParams(DensityUtil.dip2px(context, 20), DensityUtil.dip2px(context, 20));
//            pointParams.addRule(RelativeLayout.CENTER_IN_PARENT);
//            holder.iv_status.setLayoutParams(pointParams);
//
//            holder.tv_time.setTextColor(context.getResources().getColor(R.color.color_25));
//            holder.tv_status.setTextColor(context.getResources().getColor(R.color.color_25));
//
//            //灰色的竖线
//            RelativeLayout.LayoutParams lineParams = new RelativeLayout.LayoutParams(DensityUtil.dip2px(context, 1), ViewGroup.LayoutParams.MATCH_PARENT);
//            lineParams.addRule(RelativeLayout.BELOW, R.id.iv_status);//让直线置于圆点下面
//            lineParams.addRule(RelativeLayout.CENTER_IN_PARENT);
//            holder.iv_line.setLayoutParams(lineParams);
//
//        } else {
//
////                holder.iv_status.setBackgroundResource(R.mipmap.ic_logistics_bottom);
//            holder.iv_status.setImageResource(R.drawable.shape_circle_logistics_gray);
//            RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(DensityUtil.dip2px(context, 10), DensityUtil.dip2px(context, 10));
//            lp.addRule(RelativeLayout.CENTER_IN_PARENT);
//
//            holder.iv_status.setLayoutParams(lp);
//
//            holder.tv_time.setTextColor(context.getResources().getColor(R.color.textColor_9b));
//            holder.tv_status.setTextColor(context.getResources().getColor(R.color.textColor_9b));
//
//            //灰色的竖线
//            RelativeLayout.LayoutParams lineParams = new RelativeLayout.LayoutParams(DensityUtil.dip2px(context, 1), ViewGroup.LayoutParams.MATCH_PARENT);
////                lineParams.addRule(RelativeLayout.BELOW, R.id.iv_status);//让直线置于圆点下面
//            lineParams.addRule(RelativeLayout.CENTER_IN_PARENT);
//            holder.iv_line.setLayoutParams(lineParams);
//
//        }
//
//    }
//
//    @Override
//    public int getItemCount() {
//        return listEntities.size();
//    }
//
//    class MyViewHolder extends RecyclerView.ViewHolder {
//        ImageView iv_status;
//        TextView tv_status;
//        TextView tv_time;
//        ImageView iv_line;
//
//        MyViewHolder(View view) {
//            super(view);
//
//            iv_line = (ImageView) view.findViewById(R.id.iv_line);
//            iv_status = (ImageView) view.findViewById(R.id.iv_status);
//            tv_status = (TextView) view.findViewById(R.id.tv_status);
//            tv_time = (TextView) view.findViewById(R.id.tv_time);
//
//        }
//    }
//}